import autoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import {ElementPlusResolver} from 'unplugin-vue-components/resolvers'
import {VantResolver} from '@vant/auto-import-resolver';

let resolvers = [
    ElementPlusResolver(),
    VantResolver()
]

export default function createAutoImport() {
    return [
        autoImport({
            imports: [
                'vue',
                'vue-router',
                'pinia'
            ],
            dts: false,
            resolvers,
        }),
        Components({
            resolvers,
        }),
    ]
}
